package com.xuehu.cloud.config;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author guoweia@cslc.com.cn
 * @createTime 2020/11/18 14:37
 * @description
 */
@Configuration
public class ApplicationContextConfig {

    /**
     * 手工注入RestTemplate
     * @LoadBalanced 开启负载均衡
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
